package top.fzqblog.music.model;

import android.util.Log;

import java.util.Arrays;

import static top.fzqblog.utils.Constants.TAG;

/**
 * Created by 抽离 on 2017/10/17 0017.
 */

public class Song {

    public boolean net;

    public String netImg;

    public long id;

    public long albumId;

    /**
     * 歌手
     */
    public String singer;
    /**
     * 歌曲名
     */
    public String song;
    /**
     * 歌曲的地址
     */
    public String path;
    /**
     * 歌曲长度
     */
    public int duration;
    /**
     * 歌曲的大小
     */
    public long size;

    public String getSinger() {
        return singer;
    }

    public void setSinger(String singer) {
        this.singer = singer;
    }

    public String getSong() {
//        Log.i(TAG, "getSong: " + song);
//        Log.i(TAG, "getSong: " + song.split("\\.").length);
        if(song == null){
            return "";
        }
        if(song.contains(".")){
            return song.split("\\.")[0].trim();
        }
        return song.trim();
    }

    public void setSong(String song) {
        this.song = song;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public long getSize() {
        return size;
    }

    public void setSize(long size) {
        this.size = size;
    }

    public long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public boolean isNet() {
        return net;
    }

    public void setNet(boolean net) {
        this.net = net;
    }

    public String getNetImg() {
        return netImg;
    }

    public void setNetImg(String netImg) {
        this.netImg = netImg;
    }

    @Override
    public String toString() {
        return "Song{" +
                "net=" + net +
                ", netImg='" + netImg + '\'' +
                ", id=" + id +
                ", albumId=" + albumId +
                ", singer='" + singer + '\'' +
                ", song='" + song + '\'' +
                ", path='" + path + '\'' +
                ", duration=" + duration +
                ", size=" + size +
                '}';
    }
}